const path = require("path");
// import path from "path";

// 获取路径信息
// const filePath = "C:\\folder\\abc.txt";

// console.log(path.dirname(filePath));
// console.log(path.basename(filePath));
// console.log(path.extname(filePath));

// join 路径拼接
const basePath = "../../folder";
const fileName = "abc.txt";

const filePath1 = path.join(basePath, fileName);
console.log(filePath1);

// resole 路径拼接
// resolve 会判断拼接的路径字符串中，是否有以`/`或`./`或`../`开头的路径
const filePath2 = path.resolve(basePath, fileName);
console.log(filePath2);
